If you read the entire psalm in context, however, you find that the "gods" among whom God is judging are actually mere men
The context shows the opposite, that they are lesser gods, sons of the Most High Elyon.
Psalms 82 says:
0: A Psalm of Asaph.
1: God has taken his place in the divine council; in the midst of the gods he holds judgment:
2: "How long will you judge unjustly and show partiality to the wicked? [Selah]
3: Give justice to the weak and the fatherless; maintain the right of the afflicted and the destitute.
4: Rescue the weak and the needy; deliver them from the hand of the wicked."
5: They have neither knowledge nor understanding, they walk about in darkness; all the foundations of the earth are shaken.
6: I say, "You are gods, sons of the Most High, all of you;
7: nevertheless, you shall die like men, and fall like any prince."
8: Arise, O God, judge the earth; for to thee belong all the nations!
God here is El. He takes his place in the divine council to judge the gods of the nations. He decides that they will become mortal and die like men. Why? Because ‘to thee (El) belong all the nations.
This verse is an Elohist passage from the northern Israelite tribes. El was viewed as the supreme God and Most High or El Elyon. He gave the nations to his sons as an inheritance so that each nation had its own god,
This can be seen from an old passage in Deutoronomy 32:8,9:
8: When the Most High gave to the nations their inheritance, when he separated the sons of men, he fixed the bounds of the peoples according to the number of the sons of God.
9: For the LORD's (Yahweh’s) portion is his people, Jacob his allotted heritage.
It is interesting to note that for centuries verse 8 was translated as ‘according to the number of the children of ’ not ‘according to the number of the sons of God’ (see King James version). Later bible redactors of the Masoretic text changed this passage to read ‘children of ’ simply because of the polytheistic nature of the verse. A comparison of the older Greek Septaguint with the Dead Sea Scrolls shows how corrupted some of the passages in the Masoretic text had become. The Septaguint and the Dead Sea Scrolls correctly translate this text as ‘the number of the sons of God’.
So the original text of Deut 32:8,9 shows that El was the Most High God and Yahweh was ‘a god’ in a pantheon of gods who was given the people of Israel as his inheritance. In fact Psalms 89 verse 7 calls Yahweh ‘a God feared in the council of the holy ones, great and terrible above all that are round about him’.
Of course in time Yahweh merged with El as the Most High God ‘Yahweh Elohim’. In the bible there are many 'gods' but only one 'Most High' God. The bible sometimes has trouble identifying who this Most High God is.